<template>
  <a-alert :closable="false" class="mt-10 mb-10" show-icon v-if='!!selectedRowKeys'>
    <template #message>
      <div>
        已选择&nbsp;&nbsp;&nbsp;
        <span style="color: #984cfb">{{ selectedRowKeys.length }}</span
        >&nbsp;&nbsp;&nbsp;项
        <a-button type="link" class="clear-btn" @click="$emit('clearSelected')">清空</a-button>
      </div>
    </template>
  </a-alert>
</template>
<script>
  export default {
    props: {
      // 传入 false 则不显示 alert
      selectedRowKeys: {
        type: [Array, Boolean],
        default: () => [],
      },
    },
  };
</script>
<style lang="scss">
.clear-btn {
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
  height: 24px;
}
</style>
